import { customerHttp } from '@/utils/http'
import store from '@/store/index'

/**
 * 商品列表
 * https://yapi.ops.yunlizhi.cn/project/806/interface/api/46053
 * @param data
 * @returns
 */
/**
 * 订单列表
 *
 * @param data
 * @returns
 */
export function orderList(data: any) {
  return customerHttp.request({
    url: '/saas-freshx-biz/purchase/order/page',
    method: 'post',
    data
  })
}

/**
 * 订单详情
 * https://yapi.ops.yunlizhi.cn/project/806/interface/api/46783
 * @param data
 * @returns
 */
export function getOrderDetail(data: any): Promise<any> {
  return customerHttp.request({
    url: '/saas-freshx-biz/purchase/order/detail',
    method: 'post',
    data
  })
}

/**
 *  取消订单
 * https://yapi.ops.yunlizhi.cn/project/806/interface/api/46759
 * @param data
 * @returns
 */
export function cancelOrder(data: any) {
  return customerHttp.request({
    url: '/saas-freshx-biz/base/order/cancelOrder',
    method: 'put',
    data
  })
}

export function getProvacy() {
  return customerHttp.request({
    url: 'https://prod-ylzapp-public.oss-cn-zhangjiakou.aliyuncs.com/freshx/wxapp/config.json',
    method: 'get'
  })
}
